<#macro downTabInfo>
<style>
   .rhsyyhqDIV {
		    position: absolute;
		    top: 80px;
		    left: 72%;
		    font-size: 9pt;
		    display: block;
		    height: 135px;
		    width: 200px;
		    background-color: transparent;
		    display: none;
	}
	
	s {
	    position: absolute;
	    top: -20px;
	    left: 170px;
	    display: block;
	    height: 0;
	    width: 0;
	    font-size: 0;
	    line-height: 0;
	    border-color: transparent transparent #E5E5E5 transparent;
	    border-style: dashed dashed solid dashed;
	    border-width: 10px;
	}
	
	i {
		position: absolute;
		top: -9px;
		*top: -9px;
		left: -10px;
		display: block;
		height: 0;
		width: 0;
		font-size: 0;
		line-height: 0;
		border-color: transparent transparent #FFFFFF transparent;
		border-style: dashed dashed solid dashed;
		border-width: 10px;
	}
	
	.rhsyyhqDIV .content {
		border: 1px solid #E5E5E5;
		-moz-border-radius: 3px;
			-webkit-border-radius: 3px; 
		position: absolute;
		width: 100%;
		height: 100%;
		*top: -2px;
		*border-top: 1px solid #FA0505;
		*border-top: 1px solid #FA0505;
		*border-left: none;
		*border-right: none;
		*height: 102px;
	}
	.more_c {
		    height: 45px;
		    width: 200px;
	}
	.more_c:hover{ background-color: #8EC5E8; }
	.menu_c{position: absolute;top: 0px; background-color: white;}
	.menu_c a {
		    color: #101010;
						font-size: 14px;
	}
	.menu_c img {margin: 14px 30px;}
</style>
<script type="text/javascript">
function showRhsyyhqDIV () {
	if($("#rhsyyhqDIV").css("display") == "none") {
		$("#rhsyyhqDIV").css("display","block");
	} else {
		$("#rhsyyhqDIV").css("display","none");
	}
}
</script>
<div class="rhsyyhqDIV" id="rhsyyhqDIV">
	<div class="content">
		<div class="main_c">
			<ul class="menu_c">
				<li class="more_c"><img src="static/cms/www/default/img/sshd/user3.png"><a href="#" onclick="LayerShowWindow('userInfoShow_');showRhsyyhqDIV();">个人信息</a>
				</li>
				<li class="more_c"><img src="static/cms/www/default/img/sshd/pwd2.png"><a href="#" onclick="LayerShowWindow('modifyUserPassword_');showRhsyyhqDIV();" >修改密码</a>
				</li>
				<li class="more_c"><img src="static/cms/www/default/img/sshd/lgout.png"><a href="#" onclick="layout()">退出系统</a>
				</li>
			</ul>
		</div>
	</div>
	<s><i></i></s>
</div>
</#macro>
<#macro showUserInfoEdit>
<style>
.userInfoShow-container{
    border-radius: 3px;
    -moz-border-radius: 5px;
    background-clip: padding-box;
    width: 494px;
    <#if user?? && user.linkType != "ssgly">height: 380px;<#else>height: 200px;</#if>
    background: #fff;
    border: 1px solid #eaeaea;
    position: absolute;
    top: 80px;
    left: 30%;
    z-index: 1000;
}
.userInfoShow-container .title {
    border-radius: 3px 3px 0px 0px;
    font-family: 微软雅黑;
    font-weight: 500;
    font-size: 20px;
    color: #fff;
    height: 50px;
    background-color: #1C6DC9;
}
.userInfoShow-container .title span{
    margin-left: 34px;
    position: absolute;
    top: 15px;
}
.userInfoShow-container .title .close{
    margin-left: 434px;
    margin-top: -5px;
    cursor: pointer;
}
.userInfoShow-container  .el-input__inner {
    background-color: #fff;
    background-image: none;
    border: 1px solid #d7e5ea;
    color: #1f2d3d;
    height: 30px;
    float: left;
    padding-left: 10px;
    width: 300px;
    font-size: 15px; 
}
.userInfoShow-container table td label {
    color: #101010;
    font-size: 15px;
    text-align: right;
    padding-right: 24px;
    float: right;
    padding-top: 10px;
}
.userInfoShow-container .el-button {
    border: 1px solid #bfcbd9;
    color: #fff;
    background-color: #1C6DC9;
    border-color: #1C6DC9;
    margin-right: 38.333%;
    cursor: pointer;
    width: 102px;
    height: 40px;
    float: right;
    margin-top: 20px;
    border-radius: 5px;
}

.userInfoShow-container table td span {
    float: left;
    margin-left: 20px;
    padding-top: 10px;
}
.userInfoShow-container table td p {
	font-size: 15px;
}
    
</style>
<div id="userInfoShow_" style="display: none;">
<form  class="userInfoShow-container">
	<h3  class="title">
	 	<span>个人信息</span>
	 	<span class="close"><img src="static/cms/www/default/img/sshd/close.png" onclick="LayerShowWindow('userInfoShow_');" /></span>
	</h3>
	<table style="width: 100%; <#if user?? && user.linkType != "ssgly">height: 300px;<#else>height: 140px;</#if> background-color: fff;">
	<#if user?? && user.linkType != "ssgly">
	  <tr>
	    <td><label>单位名称:</label></td>
	    <td style="padding-top: 20px;"><input name="" type="text" class="el-input__inner" value="<@jmax.dc key="MATCH_COMPANY_INFO" code="${(user.extInfo['matchUser'].companyName)!}" />" readonly="readonly" />
	    </td>
	  </tr>
	  </#if>
	  <tr>
	    <td class="text_t"><label>用户名:</label></td>
	    <td class="text_t">
	   	<input type="text" name="LoginName" class="el-input__inner" value="${user.loginName!}" readonly="readonly" /></td>
	  </tr>
	   <tr>
	    <td class="text_t"><label>姓名:</label></td>
	    <td class="text_t">
	   	<input type="text" name="username" class="el-input__inner" value="${user.name!}" readonly="readonly"/></td>
	  </tr>
	  <#if user?? && (user.linkType != "zzh" && user.linkType != "ssgly")>
	   <tr>
	    <td class="text_t"><label>部门:</label></td>
	    <td class="text_t">
	   	<input type="text" name="userDept" class="el-input__inner" readonly="readonly" value="${(user.extInfo['matchUser'].dept)!}"/></td>
	  </tr>
	  </#if>
	  <#if user?? && user.linkType != "ssgly">
	   <tr>
	    <td class="text_t"><label>职位:</label></td>
	    <td class="text_t"><input type="text" name="userJob" class="el-input__inner" readonly="readonly" value="${(user.extInfo['matchUser'].accountPost)!}"/></td>
	  </tr>
	   <tr>
	    <td class="text_t"><label>电子邮箱:</label></td>
	    <td class="text_t"><input type="text" name="email" class="el-input__inner" readonly="readonly" value="${(user.extInfo['matchUser'].accountEmail)!}"/></td>
	  </tr>
	  </#if>
	  <#if user?? && user.linkType != "ssgly">
	   <tr>
	    <td class="text_t"><label>联系电话:</label></td>
	    <td class="text_t"><input type="text" name="phone" class="el-input__inner" readonly="readonly" value="${(user.extInfo['matchUser'].accountTel)!}"/></td>
	  </tr>
	  </#if>
	</table>
</form>
</div>


<div id="modifyUserPassword_" style="display: none;">
<form  class="userInfoShow-container" style="height:280px;top: 80px;">
	<h3  class="title">
	 	<span>修改密码</span>
	 	<span class="close"><img src="static/cms/www/default/img/sshd/close.png" onclick="LayerShowWindow('modifyUserPassword_')" /></span>
	</h3>
	<table style="width: 100%; height: 150px; background-color: fff;">
	  <tr>
	    <td><label>旧密码:</label></td>
	    <td style="padding-top: 20px;"><input id="oldPwd" name="oldPwd" type="password" class="el-input__inner"  placeholder="输入旧密码"  />
	    </td>
	  </tr>
	  <tr>
	    <td class="text_t"><label>新密码:</label></td>
	    <td class="text_t">
	   	<input type="password" id="newPwd" name="newPwd" class="el-input__inner"  placeholder="输入新密码"  /></td>
	  </tr>
	   <tr>
	    <td class="text_t"><label>重复新密码:</label></td>
	    <td class="text_t">
	   	<input type="password" id="confirmPwd" name="confirmPwd" class="el-input__inner"  placeholder="输入重复密码" /></td>
	  </tr>
	</table>
	<div  class="el-form-item" style="width: 100%;">
		<div class="el-form-item__content" style="margin-left: 0px;">
			<button  type="button" id="btn_select" class="el-button" onclick="restPwd('cntent_acount')"><span style="font-size: 16px;">修&nbsp;改</span></button>
		</div>
	</div>
</form>
</div>
<script type="text/javascript">
function layout() {
	$.confirm({
    title: '退出系统',
    content: '确定退出系统吗!',
    confirm: function(){
	  $.ajax({
			async : false,
			cache : false,
			type : 'POST',
			url : 'authLogin.action?logout',// 请求的action路径
			error : function() {// 请求失败处理函数
				
			},
			success : function(data) {
				var sshdId = getUrlParam("sshdId");
				<#if user ?? && user.linkType?? && (user.linkType == "csgly" || user.linkType == "zzh")>
					var url = "cms.action?skip&navCode=sshdXq&sshdId="+sshdId+"&subNav=ssbm";
					window.location.href= url;
				<#elseif user ?? && user.linkType?? && (user.linkType == "wzgly" || user.linkType == "ssgly" || user.linkType == "psgly")>
					var url = "matchLogin.action?sysLogin&sshdId="+sshdId;
					window.location.href= url;
				<#else>
					$.alert("无效退出");
				</#if>
			}
		});
    },
    cancel: function(){
    	showRhsyyhqDIV();
    }
});
}

function restPwd()
{
	if($('#newPwd').val()!=$('#confirmPwd').val()) {
		$.alert('输入两次新密码不一致，请重新输入.');
		$('#confirmPwd').focus();
		return false;
	}
	$.ajax({
		type: 'POST',
		url: "user.do?modifiedPwd",
		dataType : 'json',  
		data: {oldPwd:$('#oldPwd').val(),newPwd:$('#newPwd').val()},
		success: function(data) {
			alertMessage(data,true,null);
		 },
        error:function(data,textstatus){
          	 errorMessage();
          }  
	});	
}

$("body").click(function (e){
	 if(!e){  
         var e = window.event;  
       }  
       //获取事件点击元素  
       var targ = e.target;  
       //获取元素名称  
       var tname = targ.tagName; 
       //showUserinfo_img
       var tid = targ.id;
       if(!(tid == "showUserinfo_img")) {
    	   if($("#rhsyyhqDIV").css("display") == "block") {
   				$("#rhsyyhqDIV").css("display","none");
   			} 
       }
//        alert(tid); 
});
</script>
</#macro>
<#macro loginOnShow>
<style>
.login_Class {
	height: 16px;
	float: right;
	margin-right: 80px;
}
.login_Class .user_img{
	float: left;
                margin-right: 16px; 
                margin-top: 10px; 
}
.login_Class .user_info {
	height: 16px;
	float: left;
}
.login_Class .user_down{
	float: right;
	margin-left: 24px;
	margin-top: 12px;
}
</style>
<div  class="login_Class">
	<div class="user_img">
		<img src="static/cms/www/default/img/sshd/user2.png" style=" width: 20px;">
	</div>
	<div class="user_info">
		<div style="font-size: 15px;color: #416dbf;">
			${user.loginName!}
		</div>
		<div style="margin-top: 12px;color: #416dbf;font-size: 15px;">
			${user.name!}
		</div>
	</div>
	<div class="user_down">
		<img src="static/cms/www/default/img/sshd/down.png" id="showUserinfo_img" style="cursor: pointer;" onclick="showRhsyyhqDIV()">
	</div>
	<script type="text/javascript">
	function showRhsyyhqDIV () {
		if($("#rhsyyhqDIV").css("display") == "none") {
			$("#rhsyyhqDIV").css("display","block");
		} else {
			$("#rhsyyhqDIV").css("display","none");
		}
	}
	</script>
</div>
</#macro>

<#macro mainStyle  marginLeft>
<style>
 main {
 /**margin-left: ${(marginLeft)!700}px;**/
}
#istabShow {
margin-left: ${(marginLeft)!700}px;
}
.tab_input {
  clear: both;
  padding-top: 10px;
  display: none;
}
.tab_label {
  font-weight: bold;
  font-size: 16px;
  display: block;
  float: left;
  padding: 10px 20px;
  border-top: 2px solid transparent;
  border-right: 1px solid transparent;
  border-left: 1px solid transparent;
	  border-bottom: 2px solid transparent; 
}
.tab_label:hover {
  cursor: pointer;
}
#tab1:checked ~ #content1, #tab2:checked ~ #content2, #tab3:checked ~ #content3, #tab4:checked ~ #content4 {
  display: block;
}
.tab_input:checked + label {
  border-top-color: transparent;
  border-right-color: transparent;
  border-left-color: transparent;
  border-bottom-color: #416BDF;
  color: #416BDF;
  text-decoration: none;
}
</style>
</#macro>
<#macro headerJs>
<script>
//获取url中的参数
function getUrlParam(name) {
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
   var r = window.location.search.substr(1).match(reg);  //匹配目标参数
   if (r != null) return unescape(r[2]); return null; //返回参数值
}

function alertMessage(data,isFlush,callBack) {
	$.alert({
     title: '提示',
	 content: data.msg,
	 confirm: function(){
	     if(data.success) {
	    	 	if(callBack !=null) {
	    	 		callBack();
	    	 	}
  	  			reflushWindow(isFlush);	
	  	  }
		}
	});
}

function errorMessage() {
	$.alert("系统出现了一个未指明的错误，如果该问题重复出现，请联系您的系统管理员并反馈该故障");
}
function reflushWindow(isFlush){
	if(isFlush) {
		window.location.reload();
	} else {
		setTimeout(function(){window.location.reload();},2000)
	}
}
function  LayerShowWindow (id) {
	if($("#" + id).css("display") == "none") {
		$("#" + id).css("display","block");
		var procbg = document.createElement("div"); //首先创建一个div
		procbg.setAttribute("id","mybgDiv"); //定义该div的id
		procbg.style.background = "#000000";
		procbg.style.width = "100%";
		procbg.style.height = "100%";
		procbg.style.position = "fixed";
		procbg.style.top = "0";
		procbg.style.left = "0";
		procbg.style.zIndex = "500";
		procbg.style.opacity = "0.6";
		procbg.style.filter = "Alpha(opacity=70)";
		//以上部分也可以用csstext代替
		// procbg.style.cssText="background:#000000;width:100%;height:100%;position:fixed;top:0;left:0;zIndex:500;opacity:0.6;filter:Alpha(opacity=70);";
		//背景层加入页面
		document.body.appendChild(procbg);
		//document.body.style.overflow = "hidden"; //取消滚动条
	} else {
		$("#" + id).css("display","none");
		document.body.style.overflow = "auto"; //恢复页面滚动条
		var body = document.getElementsByTagName("body");
		var mybg = document.getElementById("mybgDiv");
		body[0].removeChild(mybg);
	}
	document.getElementsByTagName('body')[0].scrollTop = 0;
}

//15位转18位身份证号
function changeFivteenToEighteen(card){
    if(card.length == '15'){
        var arrInt = new array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
        var arrCh = new array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
        var cardTemp = 0, i;
        card = card.substr(0, 6) + '19' + card.substr(6, card.length - 6);
        for(i = 0; i < 17; i ++){
            cardTemp += card.substr(i, 1) * arrInt[i];
        }
        card += arrCh[cardTemp % 11];
        return card;
    }
    return card;
};

function checkCard(card){
  //是否为空
  if(!card||!isCardNo(card)||!checkProvince(card)||!checkBirthday(card)||!checkParity(card)){
    return false;
  }
  return true;
};
//检查号码是否符合规范，包括长度，类型
function isCardNo(card){
  //身份证号码为18位，18位前17位为数字，最后一位是校验位，可能为数字或字符X
  var reg = /(^\d{17}(\d|X)$)/;
  if(reg.test(card) === false){
    return false;
  }
  return true;
};
//取身份证前两位,校验省份
function checkProvince(card){
//身份证检验
var vcity={ 11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",
  21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",
  33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",
  42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",
  51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",
  63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"
};
  var province = card.substr(0,2);
  if(vcity[province] == undefined) {
    return false;
  }
  return true;
};
//检查生日是否正确
function checkBirthday(card){
  var len = card.length;
  //身份证18位时，次序为省（3位）市（3位）年（4位）月（2位）日（2位）校验位（4位），校验位末尾可能为X
  if(len == '18'){
    var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/;
    var arr_data = card.match(re_eighteen);
    var year = arr_data[2];
    var month = arr_data[3];
    var day = arr_data[4];
    var birthday = new Date(year+'/'+month+'/'+day);
    return verifyBirthday(year,month,day,birthday);
  }
  return false;
};
//校验日期
function verifyBirthday(year,month,day,birthday){
  var now = new Date();
  var now_year = now.getFullYear();
  //年月日是否合理
  if(birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day){
    //判断年份的范围（3岁到100岁之间)
    var time = now_year - year;
    if(time >= 3 && time <= 100)
    {
      return true;
    }
    return false;
  }
  return false;
};
//校验位的检测
function checkParity(card){
  //15位转18位
  var len = card.length;
  if(len == '18'){
    var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
    var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
    var cardTemp = 0, i, valnum;
    for(i = 0; i < 17; i ++){
      cardTemp += card.substr(i, 1) * arrInt[i];
    }
    valnum = arrCh[cardTemp % 11];
    if(valnum == card.substr(17, 1)){
      return true;
    }
    return false;
  }
  return false;
};
</script>
</#macro>

<#macro headerLogo>
<style>
label.error {
	color:red;
}
</style>
<div style="height: 16px;">
	<img alt="" src="static/cms/www/default/images/logo90.png"
		style="margin-top: 15px; width: 50px;cursor: pointer;" onclick="window.location.href='cms.action?index'"/> <img alt=""
		src="static/cms/www/default/images/pt.png"
		style="margin-top: 15px; margin-left: 10px; height: 40px;cursor: pointer;" onclick="window.location.href='cms.action?index'"/>
</div>
</#macro>